 $(function (){
	
	 $("#alter ").click(function (){
		 $("#uinfo").toggle();
		 $("#alterPwd").slideToggle();
		 $("#alter").hide();
	 });
	 $("#return").click(function (){
		 $("#uinfo").slideToggle();
		 $("#alterPwd").toggle();
		 $("#alter").show();
		 
	 });
   
	 
	   //初始化当前登录人的信息
	     $.ajax({
	    	 url :'uInfo',
	    	 success:function (date){
	    	 console.log($(date));
	    	 $("#ONAME").html(date.ONAME);
	    	 $("#O_SEX").html(date.O_SEX);
	    	 $("#O_AGE").html(date.O_AGE);
	    	 $("#DEPT").html(date.DEPT);
	       }
	     });
	 
	 
	 
	 
                     $("#sb").click(function (){
                         //判断信息是否填写完整
                    	var pwd= $("#pwd").val();
                        var pwd1= $("#pwd1").val();
                        var odlpwd=$("#odlpwd").val();
                             if(pwd=='' || pwd1=='' || odlpwd==''){
                            	 $.messager.show({ title: "操作提示", msg: "信息不完整", showType: 'slide', timeout: 5000 });
                                 }
                             else{
                            	 console.log("11"+pwd+"1");
                            	 console.log("22"+pwd+"22");
                                 //判断新密码是否相等
                             if(pwd==pwd1){
                            	  $("#pwds").html('');
                                  $("#pwds1").html('');
                            	 $.ajax({
                            			url:'../..'+window.parent._index_path+'modify/update',

                            			data :{
                         			       pwd :pwd,
                         			       odlpwd :odlpwd
                         			      },
                            			success:function(clns){
                         			    	  if(clns=="success"){
                         			    		 $.messager.show({ title: "操作提示", msg: "修改成功", showType: 'slide', timeout: 5000 });
                         			    		 $('#manage_ap').window('close');
                         			    	  }
                         			    	  if(clns=="pwderror"){
                         			    		  $.messager.show({ title: "操作提示", msg: "旧密码错误", showType: 'slide', timeout: 5000 });
                         			    	  }
                         			    	  if(clns=="error"){
                         			    		  $.messager.show({ title: "操作提示", msg: "修改失败", showType: 'slide', timeout: 5000 });
                         			    	  }


                            			}
                            		});
                                 }else{
                                   $("#pwds").html('两次密码不一致');
                                   $("#pwds1").html('两次密码不一致');
                                     }    

                             }
                          });
                      $("#close").click(function (){
                    	  $('#manage_ap').window('close');
                      });
	    	  
                      
                      
                      
                      
		      });	 